import can

# 创建bus对象
bus = can.interface.Bus(interface="socketcan", channel="vcan0", receive_own_messages=True)

# 接收CAN信息帧
msg = bus.recv()

# 打印接收到的CAN信息帧
print(msg)

# 关闭bus
bus.shutdown()
